<?php
/**
 * @Author: Xu Liu email:2867557054@qq.com
 * @Date:   2016-12-15 13:31:33
 * @Last Modified by:   Xu Liu
 * @Last Modified time: 2018-04-07 22:14:52
 */
if (!defined('IN_ADMINCP') || !defined('IN_DISCUZ')) {
    exit('Access Denied');
}
$sql = <<<EOF
DROP TABLE IF EXISTS `cdb_jamesonread_books`;
DROP TABLE IF EXISTS `cdb_jamesonread_colums`;
DROP TABLE IF EXISTS `cdb_jamesonread_categorys`;
DROP TABLE IF EXISTS `cdb_jamesonread_buybooks`;
DROP TABLE IF EXISTS `cdb_jamesonread_buytids`;
DROP TABLE IF EXISTS `cdb_jamesonread_dianping`;
DROP TABLE IF EXISTS `cdb_jamesonread_favores`;
DROP TABLE IF EXISTS `cdb_jamesonread_scores`;
DROP TABLE IF EXISTS `cdb_jamesonread_fenjuan`;
DROP TABLE IF EXISTS `cdb_jamesonread_topics`;
DROP TABLE IF EXISTS `cdb_jamesonread_authors`;
DROP TABLE IF EXISTS `cdb_jamesonread_dashang`;
DROP TABLE IF EXISTS `cdb_jamesonread_yongjin`;
DROP TABLE IF EXISTS `cdb_jamesonread_fx`;
DROP TABLE IF EXISTS `cdb_jamesonread_pdf`;
DROP TABLE IF EXISTS `cdb_jamesonread_bookmarks`;
DROP TABLE IF EXISTS `cdb_jamesonread_shenhe`;
DROP TABLE IF EXISTS `cdb_jamesonread_appguanzhu`;
DROP TABLE IF EXISTS `cdb_jamesonread_appuser`;
DROP TABLE IF EXISTS `cdb_jamesonread_search`;
DROP TABLE IF EXISTS `cdb_jamesonread_piao`;
DROP TABLE IF EXISTS `cdb_jamesonread_update`;
DELETE FROM cdb_forum_bbcode WHERE tag='cuplayer';
DELETE FROM cdb_common_setting WHERE skey='jameson_read';
DELETE FROM cdb_common_setting WHERE skey='allowviewuserdiscuz';
DELETE FROM cdb_common_setting WHERE skey='xf512seo_index';
DELETE FROM cdb_common_setting WHERE skey='xf512seo_book';
DELETE FROM cdb_common_setting WHERE skey='xf512seo_read';
DELETE FROM cdb_common_setting WHERE skey='xf512seo_cate';
DELETE FROM cdb_common_setting WHERE skey='xf512seo_shaixuan';
DELETE FROM cdb_common_setting WHERE skey='xf512read_mbstyle';
EOF;
runquery($sql);
function deldir($dir) {
  $dh=opendir($dir);
  while ($file=readdir($dh)) {
    if($file!="." && $file!="..") {
      $fullpath=$dir."/".$file;
      if(!is_dir($fullpath) && preg_match("/^jamesonread/i",$file)) {
          @unlink($fullpath);
      }
    }
  }
}
deldir('./data/cache');
$finish = true;